Change grid utility functions to static methods
Fix and test grid intersection