Fix new enum scoping rules

This commit fixes the new rules for scoping enum variants under the namespace of their type. Also, `from_str` was moved into `std::str`.