Some gui code cleanup/restructuring.
Moving some tooltip code that only needs templates to common/ to allow to use that for the structree mod.