Changes to support new version of PhoneGap

Now plugin supports PhoneGap 2.x+