Add documentation and the possibility to change the output stream.