Adds unit tests.

Resolves #2