Reorganise repo, add setup.py

Re-organise the repo, splitting code & tests.
Add a setup.py, so this can be installed (FUTURE: pypi?)