Variable bindings and error codes

Changed serialization so we can encode/decode more complex types. Got
rid of “void*”s in C API.