Use canonical class name when importing as class.

Nested class name (retrieved calling getName) returns parent name
followed by '$' and the simple class name itself. This prevents
compressing types defined in dot-separated way. While this is allowed,
it's more natural to read code separated with '.' symbols.