Add ruleblock parsing, misc cleanup