Promise plugin for apache cordova