A bunch of changes to allow for greater control of the response headers. Unchanged behavior if no extra headers are explicitly set by the applicatioin.