attach touch handlers to canvas instead

If the touch handlers are attached to the document, then tapping links
on a mobile device won't work.
combine handlers for touch events
return false to stop bubbling and defaults
misc cleanup to remove code duplication