First working version.
Simplify doc. Add example/test.