Reload grammar in editor when path changes

Reloading of the grammar when the editor's path changed regressed in the react editor since it doesn't handle these events yet.

This probably should have always happened at the model anyway.

Closes #2385