Fix various typos

This is purely a typo fixing exercise, tidying up mostly comments.  I've tried my best to infer what each programmer was originally trying to say, but this commit would certainly benefit from a quick glance over by someone more knowledgeable than me.