Use doctest to check examples in documentation