fix jslint errors
Add literate documentation