data libraries: small API changes; bugfix; deferred queue for adding datasets from history to library; permission handling work