Log, count and warn deprecations via configurable io stream Make warn_deprecation use a configuable deprecatio_io which defaults to $stderr. This counts the number of deprecations and warns about them

This is a proposed implementation for #616 and alternate to #853

I should mention I based this off the last stable release, as the current master breaks for me?