MDL-63303 core_favourites: add get and count functions