Thorough overhaul of all code. Now using a more extensional approach, which appears to be more idomatic for core.logic.