Refactored pages into indivudual js files for better encapsulation.