Multi-core mining and some pep-8 changes + slight refactoring.