Clean up mouse-handling code and add support for Project#options.hitTolerance.
Fix issue with click events on items.

Closes #179.