Homestyx hydra

R1:5ff02058a4b0

Make JX.Tooltip more conservative about positioning

Summary:
Fixes T10687. Fixes T12064.

- Primarily, adds a margin around the edge of the screen for the purposes of aligning the tooltip.
- Also, tries to flip the tooltip if it can (e.g., if the tooltip normally goes east, try west first), then tries other positions exhastively.

Test Plan:
{F2309363}

{F2309364}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12064, T10687

Differential Revision: https://secure.phabricator.com/D17145
Repository: R1 hydra
Commit Date: Jan 5 2017