Refactor to modules and test directory.
Merge pull request #2 from mnorbury/mnorbury

Refactor to modules and test directory.