General Cleanup: Deleted old commented out and unused code; Relocated functions to better spots; Changed implementation of some classes.