add tests for primitive types and fix errors
add primitive-codec to remove code