What country did Japan defeat in its FIRST foreign war during the Meiji period?