Add new log function

Replace console.log with log in configuration
Move more constants to global.js