Preliminary test code

This is the first crack at replay code that's ready to actually run.

Probably won't work at all.