[Finishes #80224520] Create 'Grid' superclass for Maze and Studio

See https://github.com/code-dot-org/code-dot-org/pull/108#discussion_r18494852