Return the templates if compiled as AMD

Hi,

this change returns the templates if the precompiler was called in AMD mode. The tests pass also.