added support for markdown templates, module-specific footers, other misc improvements