Fixed constraint crash when objects are removed at the same time as a constraint is removed. fixes #1
Various other changes.