Take snapshot of the current state of the javascript objects and load them later to preserve the state and context