Added more test, jshint 'pretest' job and some refactoring around outputting a tree to an object