Japanese officials vow to intervene in currency markets as the yen weakens to levels not seen in four decades.