Complete rewriting of the program with a cleaner separation between front and back ends.

Now the front end is messy and the back end is clean... Basically the front end takes care of data storage and access, while the back end modifies the data objects.