properly create and restore temporary directories. Update readme and generated docs.