Changed classes to use new-style python classes and cleaned up a few PEP8 issues.