Cleaned up some remarkably soupy functions. This means we can get on to actually excising disused code, now.