Switch to stdlib for OS X
Switch to inttype macros to match types
Fixes for OS X. Now compiles and passes tests