Simplify construction, add doctest examples, add more functions