moved Primitive System into new type system
TODO: clean up type system and make it easier to understand and use