Big refactor to move all of the recording and playback code into its on RecordingManager class.  Cleans up the code a lot, but not tested yet (it does compile)
merges changes.