Reintroduce type substitution
Infer class assignments in outer context
Merge branch 'master' into type-substitution
WIP
Add type inference for generic classes