Encapsulated the global and module context. Added global console.log() function for use in background.