Mac OS X support

Added support for Mac OS X. However, I think there should be some more work, I don't think we still need platform dependent code to handle opengl contexts now etc. Would be nice if somebody could look into that.