A Configurational Theory of Puzzles and Jokes