Some initial copying from the source project where I started this.
It is in process and I haven't even compiled it yet.
It needs a test suite, too.  I added a gtest subrepo but haven't started using it yet.