Restrict comparitors that are allowed by question types

* Added unit tests to ApplicationEntry and Constraint models
* Fixed issues uncovered by unit tests.