Rework definitions and add definition testing.