Add database mapping to endBy field
Add logic to endBy constraint

Factory methods are also introduced to help distinguish between the
number of repetitions constraint and the endBy constraint.
Add GUI to endBy constraint