Stricter encoding handling

The 'read' method now dies if invalid Unicode characters are detected.

The 'read_string' method now expects characters and no longer tries to
guess how to decode data. Internally-inconsistent strings are now an
error.

Various related tests have been amended to match and new tests for
correct error handling have been added.