move template-resource mapping logic to ResourceContextMapper middleware.  Add formatted print util for dicts.  Clean service class vars.