The formation and extent of the solar system comet cloud