Improve tests

- consequent use of assert
- write out test summary (because error messages my be overseen between log messages)
- clean up spaces
support non-ASCII characters in keys