Code cleanup + mocha globals