[FEATURE] Begin refactor into module, write initial mocha tests.