Unittests for core module

Depends on #381