feat(runtime): add memoization to genericType()

This is an initial implementation (lacking unit tests).

The rationale is that we need `genericType(Foo, Bar) === genericType(Foo, Bar)` for the Dependency injection in Angular.

Before this PR it was not possible to detect when two generic types match (as they are not ===).


My first iteration of the loop was a bit longer & I didn't want to have to write twice the same loop. 

I agree that with such a small loop I can duplicate the code and avoid creating an  extra array.