fixed some errors in the constraint application functions in default_constraints.js, added a whole bunch of comments and explanations of how the program functions