Cleaned up code to match pylint's standards
(Although pylint isn't so good with Python 3 yet.)

Test cases still need cleaning.