A Local Approach to Solid State Problems: Pseudo Jahn-Teller origin of Ferroelectricity and Multiferroicity