Seems cordova.exec isn't always defined, but require-ing it works better.