Change NoSuchElementException to IllegalArgumentException in RubyIO
Improve RubyIO.Mode