backend: changed dataset handling, moved helper functions to dataset class, fixed dataset size config bug