Trigger events around writing

Update blog and menu plugins to use the 'beforeWrite' event to expand <blog:*/> and <menu:*/> tags in the content.  This prevents having to each iterate over all pages in afterIndex.
Simplify the code slightly
Pull page rendering logic into a single method

Added to the mixin so plugins can also use it.