Alkaloid synthesis via the intramolecular imidate methylide 1,3-dipolar cycloaddition reaction