Major overhaul of lots of functions to fit our specific testing needs better.