Refs #792: Improve 'cms.page.beforeDisplay' event to support modifying the page, clean up events
Refs #792 - Fixes logic error