Add some test replays and test functions.

Now code can be refactored while making sure original behaviour is
preserved.