Minor refactoring of TSCoreData class.
Big refactoring and started to create tests