Preparation of Medium-Ring Lactones and Lactams by Electrophilic Cyclizations