Major refactoring: change source data format, parallelize computation.