Changed ScopingRule to deal with scala scopes

After discussion with @Lewix, we realized we had no mechanism to deal with scala-style symbol scoping, so the ScopingRule base-type now provides symbol scoping functionalities.

I also extended the optimizer macro with ClassDef and ModuleDef since some rules were throwing warnings about this.
The current behavior already existed in PathRule, both rule base-types provided pretty much the same functionalities.

ScopingRule provides scala-style scoping for code blocks. In other words, it provides masking and scope behavior for blocks of sequential code, typically in a Block AST. Basically, whenever the traversal encounters a Block AST, you'll want to call enterScope(), and whenever you encounter a definition, you'll scope it.

@Lewix needed this for some rules that were tracking possible symbol matches based on their names (string representation).