bst and coffee refactor

lots of refactoring for coffeescript. bst with a few functions. got 100% test coverage!