OO Redesign

Completely refactored the code to OO.