Fixed more bugs related to access control and incompatible return types.
Added relevant test cases.

Changed signature of isInherited to take ReferenceType instead of
ClassType.

Polyglot compiles itself once more.