Improved test coverage and js documentation