A bit of source cleaning
Use requestAnimationFrame
Use typed arrays in a few places