New packaging and unittests

Apologies for the reverted reverts