fix #29

separeted struct and constraints objects in javascript