rewritten the constraints classes to make them inheritable and less
clunky (still a lot to do)