#26: Fixes NPE when pressing more than one mouse button.

Also, added a class to abstract platform specific functionality. Fixes #26