Tests

Adds unit tests.

Resolves #4