CMS-4112 Cleanup json/xml code in API. Refactored PageComponentType to move xml/json code out in seperate class.