Split functions up a bit.
Added a setup.py.
PEP-8-ish compliance.