Added cordova.js so we can listen for cordova specific events. Then used the `backbutton` event to either fire the `goBackAction` or close the application on mobile devices depending on state.