Adding unit tests for top and bottom

Their granularity is not ideal, but they address the current use cases.
 I also did some work to remove all the magic numbers and actually show
the formula that we expect to be met.
Adding documentation and renaming offset.type.

It is now its own option, viewportAnchorLocation.