Make compatible with Rails 4 - ActionDispatch::MiddlewareStack is now an Enumeratble not an Array

Nice gem, Luke. Thanks for making this. I'd hacked something similar together but this is much more robust. I did run into problems using this gem for Rails 4, though. See if you like these changes - they worked for me.