Added tests with doctest and quickcheck.