Further refactoring, seperated files and also added a number of test specs for each of the new components.