Planning data-types.

This is a bunch of types and tests, that are required to do a
pure implementation of the planning algorithms.
`groupBy1` is a thing. In scalaz the convention for non empty things is a `1` suffix.