Added support for and fixed various issues on Mac OS X

We include a modified mousemanager now and I fixed various cross-platform oddities