Use doctest and unittest for writing tests

Commit closes #4.