Move to passing a full encoder instead of a short string

* This eliminates the global state from the encoding system.