Add integration tests

Closes #36.

(cherry picked from commit 168817a)