Refactored the CMSURLHandler to cache the Pebble Engine

  * Also removed much code duplication