Refactor Test::Quattor and add unittests

Line too long. Split it.