Added support to aggregate data in HDFS, made minor bug fixes