So how would I design a replay system?

You may know it from certain games like Warcraft 3 or Starcraft where you can watch the game again after it has been played already.

You end up with a relatively small replay file. So my questions are:

* How to save the data? (custom format?) (small filesize)
* What shall be saved?
* How to make it generic so it can be used in other games to record a time period (and not a complete match for example)?
* Make it possible to forward and rewind (WC3 couldn't rewind as far as I remember)