Use local functions in example.
Move documentation into "doc".