Updated to work with cordova 2.7 and above

Changed depricated class usage and functions, and made it work with cordova 2.7 and above
@devgeeks Please review the changes and merge