Counting and Generating Derangements