Switched to requestanimframe.
Added replay functionality.
Unused code removed.