Bug in __str__ method of Factor
``` python
from pgmpy.factors import Factor

phi = Factor([3, 2], [2, 2], range(4))

print(phi)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-78ba4ef7a080> in <module>()
----> 1 print(phi)

/home/ankur/pgmpy/pgmpy/factors/Factor.py in __str__(self)
    426 
    427     def __str__(self):
--> 428         return self._str(phi_or_p='phi', html=False)
    429 
    430     def _str(self, phi_or_p, html=False):

/home/ankur/pgmpy/pgmpy/factors/Factor.py in _str(self, phi_or_p, html)
    444             string_header = self.scope()
    445             string_header.append('{phi_or_p}({variables})'.format(phi_or_p=phi_or_p,
--> 446                                                                   variables=','.join(string_header)))
    447 
    448         # fun and gen are functions to generate the different values of

TypeError: sequence item 0: expected str instance, int found
```

Happening because of newer representation of states.

diff --git a/pgmpy/factors/Factor.py b/pgmpy/factors/Factor.py
index 6c836664..22085f88 100644
--- a/pgmpy/factors/Factor.py
+++ b/pgmpy/factors/Factor.py
@@ -435,9 +435,9 @@ class Factor:
         if html:
             html_string_header = '{tr}{variable_cols}{phi}'.format(
                 tr='<tr',
-                variable_cols=''.join(['<td><b>{var}</b></td>'.format(var=var) for var in self.variables]),
+                variable_cols=''.join(['<td><b>{var}</b></td>'.format(var=str(var)) for var in self.variables]),
                 phi='<td><b>{phi_or_p}{vars}</b><d></tr>'.format(phi_or_P=phi_or_p,
-                                                                 vars=', '.join(self.variables)))
+                                                                 vars=', '.join([str(var) for var in self.variables])))
             string_list.append(html_string_header)
         else:
             string_header = self.scope()
['pgmpy/factors/Factor.py']