Cleanup snapToGrid functions

Cleaned up snapToGrid32 and snapToGrid64, removed loops replaced with straight division/mult and flooring