Added python 3 compatibility and cleaned up code slightly.
Merge pull request #7 from johanasplund/master

Added python 3 compatibility and cleaned up code slightly.