Useful for avoiding doing an actual XHR during testing. Part of the solution for #4051 (Other part is a Karma plugin that will create the template cache). Closes #7940