Refactored the PDT view to separate the main PDT processing logic into its own function.

The PDT view has been refactored to allow other views (or any other piece of code) to process the PDT information received in a request. This allows special views that do more than just processs the PDT and display a template to handle PDT requests.
The original PDT view functionality is unchanged.