Gigantic Database Rework

Things might be broken in here for quite some time.  I'm going to need
to do a lot of testing to make sure everything is up to snuff.

On the bright side, the rework has cleaned up the code immensely!