Fix some failing rubyspecs for String#encode

This first pass at String#encode fixes 32 failures and 2 errors in the `core/string/encode` rubyspecs.

In particular, I have implemented my first stab at the `:xml` option; feedback welcome!