Formalise codebase

`setup.py` added and PEP8 fixes.