Collapse inside selection #14

The tools get now hidden properly, but caret positioning is still a bit
buggy.
#16 re-implementing some rangy stuff

Fixrefox and Chrome have wildly different behaviors regarding
selections, so I borrowed some code from rangy for detecting backwards
selection
Starting to replace rangy native with jquery