Create a StgitObject class to factorise code for property handling.