Further optimizations toward #1118. The big win in this round is speeding up Page lookups in the Sidebar.