Moved logictree to commonlib and fixed all the tests

See https://bugs.launchpad.net/oq-engine/+bug/1294601