Bug 979134 - 1/N: refactor head.js a little bit.
Bug 979134: convert test_mobile_networks.js to Promise.
Bug 979134: convert mobileconnection martionette test cases to Promise.