* Implement a much more sane encoding model (closes #60).