[JS] Address issues in web push found with functional tests

- Added a small delay in calling window.open and close in login flows due to issue with InAppBrowser on iOS devices causing navigation errors.
- Allow APNS to take a json object as well as a string for template body
- Fix bug with callbacks not cleaned up from moving the promise layer down to the registration manager and not the push.web.js file.