Fixes #788 - Fall back to config theme when db theme fails.
Refs #792: Improve 'cms.page.beforeDisplay' event to support modifying the page, clean up events
Refs #792 - Fixes logic error