Fix choice encoding

Fixes bug #15 - choice encoding had no tests and was broken
I generally use camel case in all my projects, could you please change variable names?