Finally managed to get part 2 of day 9 of #AdventOfCode working with a binary heap and a performance improvement to sorting with custom comparators.
Also added some utility functions for debugging so I don't have to keep commenting/uncommenting bits of code.