Moved page number code and added some hooks for styling it better.