Working (ish) optimized version at -O2, not asm.js yet