Centralize encoding guesses, default to UTF-8

This might not be enough for print() and could need a locale.setlocale()
even though it is generally discouraged.

closes #1352
pastoob: Add an option to set a custom file encoding
Use class attributes as much as possible for application output

refs #803