using Cocoa instead of Carbon for OSX

I've changed the osx code to use Cocoa instead of Carbon. I was having issues compiling on OSX Mavericks so I decided to update the code.

_Things that don't work yet_:
Misc.getKeyState
Registry.*