Adding "encoding" configuration (4th version)

Rebased towards current master, to support elimination of monkey patch to File.read.

Need tests. (require some discussion)