Initial commit of features

This is not functional but much of the underlying code is in place and
at least somewhat documented.