Singapore has ordered the quarantine of nearly 20,000 migrant workers after a spike in cases were linked to two dormitories housing migrants.