Moved everything to do with replay into a global struct and added docs. #7 is now done.