First draft of the rule parser.

It can now extract conditions, path and keywords to substitute in the
path, but there are still many things to iron out.