Recovery API

Unifies all recovery code to use common state tracking classes and
methods. Reports on all cluster-wide shard recoveries from snapshots,
gateways and peers.

Refactors the cat API to use this new internal recovery API.

See #4637
Changed serialization for enum types.

Made comments per Igor's suggestions.