Tests and JSDoc.
Merge pull request #1 from oscarpalmer/tests

Tests and JSDoc