A note about day 17
Day 17 was a bit tricky from a software engineering perspective, and I couldn't (quickly, at 2am) think of a ncie way to generalize between the two parts, so part 1 and part 2 are more or less copy paste, with some common functionality broken out.
The code is gross. Sorry.