Added saving/loading of rules. Fixed data name collision bug.