Add setter for CopyOnDemandEnabled.

And rename getter for it.

 isCopyOnDemandEnabled() ->
getCopyOnDemandEnabled()

Also add test for it.