Issue 144 rebased and cleaned up.

This is a rebase and single commit version that succeeds from
https://github.com/metapolator/metapolator/pull/228