JavaScript: Fixed constantFoldNode
Converted some relation classes.