Clean BOM, pep8 conformance, sanitize code