Cleanup.
add basic reducer test
Clean pep8 & pylint, add more tests.