It refers to the cat o' nine tails, which was used to punish sailors in the Royal Navy and was, supposedly, kept in a special bag.
It's also where "not enough room to swing a cat" is said to come from.
http://upload.wikimedia.org/wikipedia/commons/0/09/Cat-o%27-...