Support mode argument.

An error occurred when specify a string of mode for the second argument to open method.

```
irb(main):001:0> open("http://safe.com", 'r')
TypeError: no implicit conversion of Symbol into String
````

I tried to fix this.
Please consider it if you want.