Clean up white-space.
Implement propper support for pointer events and MSPointer events.

Closes #406 and #336.