Adds an extra check for the size of variables and cardinality. Earlier even if the size of variables and cardinality were not same the Factor object was created
corrected tests according to the new representation of Factor class #137