core: main.js,config.js ported. Use async for serial execution