WD 40 is a Water Dispersant mixed with solvent chemicals. It is very hard on the rubber oring seals on a chain. I use kerosene (engine flush) in a spray bottle, then wipe dry with cloth rags. Then l carefully blow off any remaining residue with my compressor. I would never use water to wash a chain. After cleaning, go for a short ride to warm up the chain and then lube on the center stand spinning the tire in reverse.
It may be lore- but I'd heard many many year ago that the 40 was because it was the 40th attempted blend of whatever- meaning they tried 39 other things first before settling on that.
I found this tool on a YouTube video and ordered one today. It is called a Grease Ninja and supposedly makes lubing a chain easy and clean. Hopefully it works.
http://www.greaseninja.com/