Split EntityPerPage rebuilder code into separate class

Change-Id: I1325ffb20d4094890337084cd2379652e0099c4e