Add CRUD tests, generalize a bit