Modified to make pep8 compliant. Converted function comments to docstrin...

...gs. Modified file open commands to make use of 'with' statement. Minor whitespace cleanup. Modified gitignore to exclude .pyc files.