Contribution

Drastic changes in the API and examples.