Define structs for the return type as well as the in-parameters.
Properly encode pointer types.
Merge pull request #85 from pjonsson/bugfixes

Define structs for the return type as well as the in-parameters.