converting into Phonegap plugin
updated README, fixed minor bugs
fixing compile errors and cleaning code
Merge pull request #2 from alexeyismirnov/master

Plugin which is compatible with latest Phonegap