Python version issues
Fix for problems discovered when using Python 3.8:
- rewritten lazy_import, as it caused stack traces and hanging in 3.8.
- fixed a number of failed test cases (RuntimeError: dictionary keys changed during iteration in nomad.app.v1.models._validate_query).