corrected marginalize function according to the new representation of Factor
improved the _marginalize_single_variable method [refs #137]