Initial version of input-replay.

Copied a lot of code form input-create; will clean up in a bit.