Rework config/flags (fixes #13)