Heterocyclization Reactions in Ionic Liquids: A Computational Study