Refactoring: break up the coappearances function.

This will make it possible to build coappearance networks over arbitrary page ranges in the future.