Files now more conforming to PEP and loads of comments added.