fixed some bugs, added Jasmine unit tests, removed numeric prefixes, and organized code