Support for Python 3

Added modifications to use single code-base for both Python 2 and Python
3.
Support for Python 3

Code tested against existing functions in the unittest file
Merge pull request #20 from indranilsinharoy/Python3support

Python3support