Move modals into templates and set up helpers