add optimiser to build script |  corrected core.js in accordance with the loop closures transpiling limitations