Implements tests. Closes #4