Changed internals to use a Rack::Request object instead of looking at env variables