Bug 915055 - Move functions from contacts.js