Cleaning up code.

Beginning code clean up; erased much if not all legacy code on the back end for preparations to refactor and document.