Do not render footers, headers and sidebars if (after formatting) they are empty. Resolves #398 .

Might benefit from refactoring, but does the job. Thoughts?
You can omit every `return false`. Apart from that it does the job!