Sorted setup.py.
Major restructure of the code.