Initial full commit of code.  Development version.

Code works but needs significant updates to make use more general and
applicable.