Synthesis of Functionalised Pyrazolones and Imidazolines/Imidazoles through Divergent Annulation Reactions