add ElemRepository implementation and tests