Add functional tests

Closes #17
I'd say this can be merged and then that be taken care of in another PR.