Cleaning up codebase and PEP8-ing where applicable