Implement grid mode, and hook install/uninstall callbacks (needs testing)