Add Kate modeline.
Refactor for loops.