Add the chainoptions module

A general module for chaining options together has been added. It should
be a very powerful mechanism. But right now it needs more testing, both
for the correctness of the code and the utlity of the method.