Added some support for nested generics, it's going to be slow and a bit quirky for now.