Build templates as AMD modules and load via resolver, thus removing a dependency on a global.