Fix all flatMap impls, initial R impl

Also add kind-project to project