adds __hash__ method to Factor class
reordered the import statements according to standards
Merge pull request #136 from ankurankan/dev

__hash__ method for factor class and reorder import statements