Add a setup.py and other boilerplate
Set up a test infrastructure

I'm afraid test coverage is rather poor.