Support more logics, use feature flags.

Use feature flags to define the logics.  Remove the ugly switch
over logic commands.
Add flag to enable warning but not info messages