Another complete rewrite. This one is sticking! Tests now depend on Q. v0.1 release coming soon...