Logic tree implementation for the OpenQuake risk engine