refactored PathConstraints.js
fixed two bugs in Single2.js pointed out by Liang Gong.
cleaned up logging code.
resolve conflicts