Add check if window.cordova exists before running push notifications
Refactor code
Merge pull request #108 from fatchicken007/master

Refactor code and fix bugs in battle controller