Made refcounting in SGObject use the RefCount class [WIP]

Unref also remains to be discussed