LPS-50359 add TreeModel boilerplate when generating CLP model

Note that the `updateTreePath` method assigns `_treePath` before calling
the remote model. We need to assign the treePath there because the first
thing the remote updateTreePath does is to call `setTreePath` (and so we
have to guarantee that the argument given to updateTreePath will be
returned by getTreePath in subsequent calls, even if something fails).