Refactor mobilenetwork.js code (bug 1056088)

https://bugzilla.mozilla.org/show_bug.cgi?id=1056088