Adjust compiled templates loader to suport AMD.