some preliminary preparation for hierachical, fix a bug in testNewDoc.py in kfidfdf
add additional support for heirachical clustering