Review Unit class

* Add 100% code coverage
* Add custom error code
* Linted source and test
* More descriptive test messages
Merge pull request #823 from eordano/review/jsdoc-unit

Review Unit class