More pagination work. Mostly finished.