Update Page.route API so that it returns a Page instance rather than an HttpResponse; catch the latter in the 'serve' view for backward compatibility
Move the 'hooks' module from wagtailadmin to wagtailcore
Catch the deprecation warning for old-style routes during unit tests
Implement before_serve_page hook
Add PageViewRestriction model, and apply permission check in the 'serve' view