Generic list code generation

Getting the generic types in is a bit of a hack right now. Do something
better.