Add docs and tests