Various compliance fixes

Mostly having to do with correcting regular expressions and adding more test cases.

Also made references a nested hash to make the dict more extensible.