Reorganise repo, add setup.py

Re-organise the repo, splitting code & tests.
Add a setup.py
Merge pull request #1 from jamesbroadhead/master

Reorganise repo, add setup.py