Drafts for periodic range logic.

Still need the tests to check all of this, and to make sure it gets
correctly used in volume.py.