Moved code to register push notifications to a seperate file.