npmjs ready

Fixed up some minor things like detection on OSX and got ready for npmjs.