Tidied up loading of modules and templates