Clean up code. Make app work outside cordova.