Set up mocha for testing
Refactor

Refactor into files that make more sense.