added functional test, integrated mocha output in tracking test, refactored everything