Implement nqp::setencoding, add more I/O related ops.