Solving Quantifier-Free First-Order Constraints Over Finite Sets and Binary Relations