Added first implementation of marginalization of a factor.