Added flag for optional body rewriting for rewrite middleware.
More efficient template processing for the rewrite middleware.