Refactoring.

- Use for_each where convenient
- Add a 'cond' parameter to GetNeighbors to return only neighbors that
meet the condition. Use this parameterized version in places where
counting mines.