Completely revamped code to be more OO. Much happier with the codebase. Backend can be completely tested independent of the front end now.