Advances in ab-initio theory of multiferroics