Add library code, example and test.
README: update README with example code