fix RefDataManager and add firts working test on it
merged from refdata