Various usage fixes.

1. Explicitly specify a compilation database in all cases
2. Specify C or CXX modes in the compilation database
3. Rename ALLOW_WARNINGS to WARN_ONLY
4. Fix behaviour of ENABLE_CHECKS/DISABLE_CHECKS