Update cobol.py

Add python3 support, replace print statement by call to logging module, fix a few PEP8 issues.