data libraries: improved chaincall for importing datasets into history, some cleanup