Moved code to handle push notifcations to inside pushnotification-client.js