Refactor frontend to use templates
Initial South migration script