Added caching for the ctx objects when pages are instantiated from
templates and context json files.