copied js files from blockly-core