fix bug in calculation of # of cores
optimize function splitting and name detection in js optimizer, no need to notice indentation