Add map() and flatmap()

As discussed in #11.
I’d suggest using the `minimumCapacity` initializer here.