The president of South Korea has declared "emergency martial law", accusing the country's opposition of controlling the parliament and sympathising with North Korea.