npmjs ready

Cleaned up code to get ready for npmjs.org publishing