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 scoping API is now in PathRule which does pretty much the same thing as ScopingRule did. You can already port your rule to PathRule which provides `matches` instead of `in` to check traversal scoping.

What I'm trying to achieve with ScopingRule is handling symbol scoping with masking and stuff, which is not the same as traversal scoping. This would enable symbol lookup based on string name representation, for example, which can't be achieved with the current rule base-types.

Unfortunately, I've discovered that `enterScope()` calls are not so easy to place correctly, so it really makes sense to write the whole scoping mechanism ourselves, lest the rule writers mess up. For example, DefDef vparamss need to be in the DefDef scope, which means calling `enterScope()` in a DefDef case too (and in between adding the DefDef to scope and adding the vparamss).

As I said, I'll try working on this during this week. I believe I can possibly deal with imports using the `members` field, so maybe I can get full symbol scoping support. For now, rules should not use the ScopingRule base-type and move to PathRule which provides an equivalent API.