Cleaning up python wrapper.

* Fixing compiler bugs when compiling c++.
* Adding features described in Plugin Wrapper | Python wiki page.