dump-datasets command, more tests and fixes