session cache cleanup and HTML safe JSON support cleanup