API, pt II: Pagination

This adds pagination to the machines resource. Included in this PR is also a bonus commit that adds some testing of the serialization code.
This function is nice and all, but it doesn't appear to be actually getting used anywhere....