Improved touch/mouse input
* Properly handle dragging outside of the canvas
* Clean up some emscripten JS calls