Which nation forced Japan to open its ports to foreign trade?