Made the following changes
1. Improved documentation.
2. Added sanity test.
3. Moved example to a separate folder
4. Optimised compuation of centroids.
5. Added underscore to public attributes.