See Jokes and their Relation to the Unconscious by Sigmund Freud for a similar analysis with far more depth.