Port shell based tests from self-test to proper unittests

Fix spacing in setup.py
`./setup.py test` now works.

Closes #8