State saving and loading

This fleshes out the state saving and loading code, and exposes it as the format by which Glue sessions are saved and loaded. This also deprecates the old pickle save files