Removed deprecated setmeta syntax and fixed unicode issues.

* Fixed a few cases were stdout and stderr was not being encoded as bytes.
* Removed deprecated setmeta syntax.
* Fixed setmeta unicode/ascii handling logic.
* Added more setmeta test coverage and removed deprecated syntax tests.