moved GridDef to core module, added tests