Moved the loadPagelogic to the Page Class

Because it makes sense and in effect we got rid of some unsafe calls to
globals that are assumed to exist.