Changed the structure of self.factors to reduce computation and increase memory usage
Basic implementation of variable elimination [refs #187]