Updated to support phonegap 3

Updated code to support PG3 on ios and android. Looks like some code style issues may be here now that I look at github's diff. I'll try to clean that up later if it is an issue.