Removed a ton of duplicating in common.inc, and added support for Readmill's pagination.