Refactored project to use classes and objects, code flow now 100% more difficult to follow but should now be more easily extensible