This is our currently running code as of, well, right now. It's been stable and we probably aren't going to make changes in the near future; it seems to do everything we want so far and I'm wary of adding too many clever analysis features.