use doctest, improve README readability

doctest for testing, improve `README`.