Remove unused imports.
Implement Converter#primitive_convert, fix several encoding bugs.

This implementation of primitive_convert is close to complete but
is not particularly efficient, copying too much and reinitializing
Charset transcoders every time. We will want to look at improving
perf and avoiding copies as much as possible. I believe we can
do this by making better use of the ByteBuffer wrapping logic and
only copying when we must.

Stateful transcoding is still a bit iffy, since we throw away the
transcoders between runs. This will need to be fixed to allow
full partial transcoding in phases with proper finish logic.