Cordova 3.x compatability

First attempt at making the plugin compatible with the cordova 3.x
Plugin structure