The night before, soak the black beans in a large pot of water. The next day, rinse the beans, cover with 3 cups of fresh water and bring to a boil over high heat. Reduce the heat and simmer covered for 30 minutes, skimming off any foam. Stir in the onion and simmer 30 minutes more. Add the garlic, oregano, cumin, and red pepper flakes, and simmer uncovered for 30 minutes, stirring occasionally. Stir in sugar and vinegar, and taste before seasoning with salt and pepper. Turn out into a large serving bowl and garnish with chopped scallions.