Rewritten RelEx2Logic rule engine

Rewritten rule engine, fixing issue #23, #32, #33, plus a few others I didn't report.