Handle per group flag files

Before this commit:
Flags are read from test/files/*/<test-name>.flags file and used for all
scalac compilations of the given test.

This commit adds the following:
- per group flag files for scalac (with "flags" extension). This is
  available on master.
- per group flag files for javac (with "javacopts" extension)

The file name for the per group flags file is determined by the
alphabetically first java or scala file name of that group (just like on
master)

Also, the options can be separated by space or newline.