Refactors the code base to make it easier to extend and test individual components. More work could probably be done to improve it further but what is included here is a decent start I think
Adds an initial set of unit tests. More can be added on top of this. Partial resolution to #41
Description