Moved the logic tree tests from the engine into commonlib

The tests are green: https://ci.openquake.org/job/master_oq-risklib/906/