Rand al'Thor makes the valid comment that as with many nursery rhymes it doesn't have an author.
The earliest known published version of it comes from a manuscript dated to around 1730 , though as it was a nursery rhyme it was probably in use orally beforehand. The modern form was first printed around 1825.
You ask about earlier versions being clearer in the comments, but the only difference in the earliest known version is it says nine instead of seven.
The riddle doesn't have a definite answer, though 1 is the general accepted answer. While the answer could be 7+49+343+2401+16807+1 which is 19608, remember this is a children's nursery rhyme, and the purpose of it wouldn't be to make little children do ridiculously long sums, so the intended answer is likely to be 1. The riddle would have been designed to surprise people with the simple answer.
The poem may have been developed to help the lateral thinking and problem solving skills of the children, to make them think which way the people were travelling. The words in nursery rhymes are usually included to make the poem humorous, or just to make it rhyme, usually both reasons are present. They need to be simple and words children would know or will know in the near future.
Nursery rhymes also often create nice visual images for the reader, and woman, sacks, cats and kittens would be easy to visualise for the child.
All info from wikipedia