Add grid and resize handlers.