Track global recorder/replayer state in a new Session class.

#603