Fixes problem with toolbar position when selection is at the top of the screen

For selections at the very top of the screen, the toolbar goes off-screen because it hovers above the selected text. I just added a condition for it, and moved it below the text when needed - adjusting the "arrow" accordingly. Illustrative image in comments.

Also, clearly I am struggling a bit with the jslint.. trying to get it fixed.

My incompetence with git is coming to show; the history is now super ugly. Tried to "fix" my original commit, but failed. The patch works, however..

If you think the patch is ok, maybe I can try to fix the history, or maybe it's easier from your side to merge something in specifically. I don't know. I also think I could fix the positioning for edge-cases (ha-ha) i.e. sides of the screen (I see there is an issue open for this).