Added Grid class, refactoring of inserter and tests