Add integration tests

Closes #36.

(cherry picked from commit f2c83df)