Refactor Test::Quattor and add unittests