Added flatpages support and 400/500 templates.