Near-total re-jigging. Incorporated more object oriented design. The code sort of works, but i still need to go through and remove the bugs introduced by this rewrite.