Synthesis of Complex Heterocyclic Scaffolds through Cascade Processes Based on Multicomponent Reactions Followed by Palladium Mediated SN2' Cyclizations