Rework of constraint parsing with tests passing