Add test to reproduce issue 29.
Skip unexported fields in encode

Fixes #29