Implementing most important parts from chrome.runtime API.
Finished feature 55962600/new-chrome-apis.