Skip unexported fields in encode

Fixes #29