Refactor directional to use visible area of element.

* Used for calculating the best cardinality to position the element relative to it's anchor (container).
* Returns an offset of how far off screen it is so that the element can be repositioned on screen if necessary. This was necessary for pops.
* Allow the rotation of cardinality checks to be provided to set precedence when there are several viable options.