Rule parser improved significantly, although valgrind still reports a couple leaks;