Added unit tests and bug fixes.  2 Unit tests are causing Jasmine to hang.