Fix choice encoding

Fixes bug #15 - choice encoding had no tests and was broken
Definitely there is. If you have a bug in encoding and the same bug in decoding, ping-pong test would not detect it.