my attempt at it
employed some aggressive caching so we don't recalculate the spiral all the time, which is rather expensive computationally
improved end handling, and optimized the algorithm
Unified formatting
Putting back raf abstraction

Original code used its own requestAnimationFrame() abstraction. Reason
for that was that - with this function we still can leverage browser's RAF
and abstract away all timing issues.