improved api for optional_rendering

When I was looking at the viability of overriding the header view, I got really disgusted with how ugly the menu handling is.  Here's one attempt to clean it up.