Add unit tests and examples