Functional but hideous. Extensive cleanup/refactoring required. DO NOT LOOK AT THIS COMMIT. I would be mortified if someone judged my programming based on this mess.