fix($templateRequest): ignore JSON Content-Type header and content

Normally, if there is a Content-Type header with the string
"application/json", or else the content looks sort of JSON-y, $http will
attempt to deserialize the JSON into an object. $templateRequest is intended
to request markup, and as such should never attempt to parse JSON, regardless
of the headers or shape of the content.

/CC @IgorMinar should be quick to review

Closes #5756
since you are doing 3 "heavy" array operations (indexof, copy, splice), it might be better to just have one for loop to manually copy stuff over except for the default transform