Add Mpq::fmt

Also add corresponding test.