Adding unit tests and jsdoc tags