index: fix prompt return format, detect plugin on the fly
index: fix prompt return format, detect plugin on the fly

Also fixes the returned button indices to be more consistent

dcousens/cordova-dialogs