Note that we have https://github.com/mozilla-b2g/gaia/blob/master/apps/sms/js/settings.js in SMS, seems to be quite similar to this. (but better :p (subjective))