passing module simplifies API a lot
adding example and docs in readme