kwargs for open() and _io.FileIO()

This provides more CPython compatibility but is mainly done in work towards a fix for #874: the mode kwarg is fully implemented, and the encoding arg is allowed so now the tests can specify `encoding='utf-8'` which makes sure CPython uses the correct encoding for opening the files instead of the encoding derived from some environment variable.