Add maybe_invalid/1, use the right config_file
Add is_behaviour/1, improve sort_by_priority/4
Validate parameters first