refactoring Hahet/Core, and a simple cabal test setup