Break definition repository out and restructure tests