Made generics work
Made generics work.
Fixed compatibility, added generics
Splits correctly most of the time now. There still are some corner cases.