Kore first2

The idea of this commit is to split FlattenSyntax into two, so that one of them can be gradually moved before others to reduce the definition to KORE as soon as possible.

I believe this is a bad commit for a code review, but I would like guidelines.

First, the code I'm modifying has tabs.
Next, IntelliJ Idea has the nice habit of compressing imports.