Pyrrolizidine and indolizidine syntheses involving 1,3-dipolar cycloadditions