Isolating code, helper functions and Unit testing Mocha