move JSON rendering code out of container header file. prerequesite to #1261