Universal Module Definition, minor fixes (pointed out by jshint)

I intend to use the lib for both node and browsers. Registration of the lib with bower and/or jam will be a plus ;)