Move all flags to the main binary file.

Shall we make this dependent on the last query time? This way we can make the global housekeeping easily configurable.