Added a destructor to `ClientModel`.

This should help avoid memory leaks by deallocating all the stored
`Change` instances that accumulate during tests.
Added tests for `ChangeLayer` events.

These tests ensure that `ChangeLayer` events have the proper contents,
and that they occur at the correct times:

- `test_layer_change` ensures that events are fired when a layer is
  changed, but not when it is set to the same value it had before.
- `test_layer_extremes` makes sure that duplicate events are not fired
  when a change occurs when a layer is not changed because it is on the
  boundaries.