[doc] complete rewrite of module documentation, with full example module