fix NaN check
mpc: add more api funcs
compile javascript files with the closure compiler