Remove most uses of smartmatch.

Perl 5.17.11 emits warnings that it is experimental. So
remove most uses. Kept it in ItemFormatter, where `given` is so useful,
but silenced the warnings there.
Suppress smartmatch warnings only on 5.17.11 or higher.