[kihx] Optimize the entire pipeline.

- Fix a bug about computing min scanline.
- Remove inefficient usage of STL containers.
- Use SSE optimization.
- Add a grid scene modifier.