Prior to commodore perry's visit, the country of japan had held a rigid policy of isolation since the _______.