new maths-finding algo; give up on getting caret position

New algorithm for identifying maths areas should be quicker and more
accurate. It copes with \begin{} ... \end{} environments and multi-line
maths, now.

I've given up on trying to find the coordinates of the caret. The way we
use writemaths now is to position the preview at the top of the editable
area, because big previews were covering up too much of the text you
were editing. It's a massive faff calculating the coordinates, so I've
decided not to bother.

Because I'm doing less complicated stuff, you don't need jquery
backward-compatibility any more, or the caret-position-getter libraries.