Made the background page able to go to sleep by adding "persistent": false to the manifest.json file, fixed it's formatting to be consistent.
Also changed the chrome.extension calls to chrome.runtime calls.