Fix non default request formats

The request format is set before the request instance variables, causing
all rendered templates to use the default request format.
Merge pull request #561 from bhicks/fix-non-default-format

Fix non default request formats