First cut at porting to asm.js

Doesn't at all work yet...