Fixing page resetting, moved loaded flags to JSON out of the DOM for faster page generation.