Merge pull request #7 from halfak/master

Refactoring, + examples and fixed py3 bug
Minor fixes to documentation.