Web Replay: add infrastructure for memoizing nondeterministic DOM APIs