Implement the algorithm for finding a cues best position on the caption overlay.

- This supports horizontal text only. It needs a few tweaks
to fully support vertical text.
- The test suite has been altered to balance the computed values of
processing model tests since they will be different on different
platforms. This means calculating offsets based on differences in
computed line heights and applying the offsets to the different
CSS position values.