Add QUnit test and jsdoc