config.js added. Some refactoring.