moved Grid and ArrayGrid to core module, added tests