gofmt
Start refactoring encoder.
failing test
Close #39.

Added @SvenDowideit's round trip test which reproduces the bug in #39.

Close #40.