I think humour is the pleasurable feeling of your brain leaping from its predicted track to a surprise way of looking at the same idea. Surreal humour does it without wires, other types of humour use a device (like similarity of word sounds) to jump you across to the surprise point of view. I think cruel humour, or sexual humour, is just a sub-category of this. 'Nice taboo you got here... shame if someone broke it'
Phoenician suggests there are two types of humour (perhaps a bit of the old 'there are two types of people' thing going on here). One is Neophilic - the same as what I was saying, pleasure of the new. He also proposes that there's a second type of humour, Neophobic, which concentrates on ridiculing things that are new and different. You could argue that the humour of the familiar ('Airline food is crap' type humour, or when you laugh because someone says something which is so typical) is Neophobic.
I saw my daughter in a performance of Bugsy Malone the other day, and I was struck by how some people in the audience laughed most loudly at the weakest most predictable jokes. Perhaps taking pleasure in the very predictability and communality of the joke. Perhaps Neophobic jokes are like that, bonding people round safe familiar thoughts.