DOMCache saved as json not global var

This changes save DOM cache as application/json script type rather than using window global variables.