Restructure grid to be a separate module. Clean up some code. Not a clean commit. Kill me.