[ttb] Part way through code redesign

I'm partway through redesigning ttb.c to be much more readable. Just pushing since we are switching computers