Refactor nodoc.js.
Add basic tests using jasmine.