Abstracted the paging calculations where needed, added paging to SHP, fixed some small definition issues.