Issue #15 WIP. Needs tests and completion.