Refactoring into modules

Refactored the main update and draw to support modularization