Bug 995853 - No profile details are visible

I think that we're doing the same thing in wappush.js when preparing the title of a notification. Please factor this code inside a function and put it in utils.js.