Rearrangement of ammonium ylides produced by intramolecular reaction of catalytically generated metal carbenoids. Part 1. Synthesis of cyclic amines