Pytests for core

Quite a few tests for core, which do not need a network connection. May be a few more to come, but could be committed already.