G7 agrees to tax big firms and squeeze havens