Reorganise repo, add setup.py

Re-organise the repo, splitting code & tests.
Add a setup.py