Create a core Singleton

OOPize the system (and prepare it for Gadget testing)
Split the core and editPage functionalities