A unified model of microsegregation and coarsening