Test primitive types

... and fix two bugs:
* negative int32 was not written properly
* generated code with packed double could not be compiled

Packed sint types don't work properly yet.