Upgraded to QGIS 2.0 API

I made some changes in order for the plugin to work under QGIS 2.0. 
I believe that with these changes it won't work for 1.x anymore but I have not tested.