Updated the middleware registry for faraday 0.9

I replaced using `Faraday.register_middleware` with using `Faraday::Middleware.register_middleware`, `Faraday::Request.register_middleware` and  `Faraday::Response.register_middleware`, since the `Faraday.register_middleware` method is removed in faraday 0.9.

This also works with faraday 0.8.