store: implement reference counted storage