Moved RefCount to own file and used that class for ref counting instead of a plain int in the classes SGIO,Version and Parallel