Test Unittests first

Beware, this pull request also contains the PR of @davisagli 
As it is an extension of his stuff