Major Refactor to make future work easier

All the test cases are passing… but need more test cases!
Hmm the files left behind..