Issue #39 - initial implementation; needs gobs more testing.