Adding functionality to record and replay sessions

closes #10