Make code compile (fix issue #3, makes issue #1 obsolete)

This commit contains a complete reimplementation of the marshalling code
which is now done mostly in C code. I use a dirty hack to get around the
inability to access Go types from C code in my code, see commentary in
marshall.h for more details.