Move and unify config.read() to main.js