Further restructuring; added in a bunch of code from some previous projects, refactored to be fairly consistent.