Add initial code

- copied from abandoned v1.2.1 branch

Signed-off-by: Robert Tipton <tret@tretflix.com>