Make things faster

Most of this is query optimization. We're making significantly fewer queries for common pages like the index.