Reductive amination cyclization route to nitrogen heterocycles: studies in the synthesis and stereochemistry of piperidines, pyrrolidines and 8-azasteroids