Extensive refactoring. Now loads page objects from the database, though!