Refactoring and minor performance improvement in DotNetNuke.Common.ProcessHttpModule

See https://dnntracker.atlassian.net/browse/DNN-6098.

This pull requests is for the current development branch. I've also created one for 7.3.3 https://github.com/dnnsoftware/Dnn.Platform/pull/196.