Refactor so stored item is cleared whenever nullptr is set throught the API.
Refactor so stored item is cleared whenever nullptr is set throught the API.

hsorby/libcellml,cellml/libcellml,cellml/libcellml,nickerso/libcellml,nickerso/libcellml,nickerso/libcellml,hsorby/libcellml,hsorby/libcellml,cellml/libcellml,hsorby/libcellml,cellml/libcellml,nickerso/libcellml