Added instances and improved generics code

Hi,
So, I guess I probably refactored a little more than needed (namely the tests and module name), but I think the final result is worthwhile:
* More instances
* Generics code now supports recursive structures (thanks to [JPM](http://dreixel.net/).

I've contacted Lukas Mei to see if he his open to accepting your original Generics patch, no answer until now.

What do you think of this?
Thanks