NF/RF: Add back gen_cdfs_from_dataframe(), completely reworked