Refactors to add support for templates, moves assumptions panel to an external template.