Moved extension.onMessage function to the messenger.js file