Add links and pagination for versioned requests.

When document versioning is on, add `?version=<version_num>` to HATEOAS `self` links. Also adds pagination links for `?version=all` and `?version=diffs` requests when the number exceeds the max results.

Partially addresses #475. (I've still got one more PR to go to finish it up, related to #464.)