move fastcomp simplification code into emcc, and simplify it