Add tests for organize function.
pep8 and pylint fixes.