reorganization and some optimization

no more slow iterrows for putting distance computations back into the
master doclevel_df