Ranges

Note: this branch includes the changes in PR for issue #116.

This includes the start of my proposed lib/range library. I think they would be a useful tool to include for users. As a means of dog-fooding, I have switched the lib/dir library over to using them. It doesn't buy a whole lot now, but it does make the lib more flexible and adding new features easier.