Externalised html templates

Implementation code still needs to be fixed