Encode to bytes on output

This maintains backward compatibility. Since the main use case of
MoSQL is to feed the output directly to database APIs, this should
be the better approach.