overhaul tests, add repository tests