Tidy up dependencies

I started by updating rack and json to pick up important recent updates, but it seemed useful to tidy up the gemfile and review a few dependencies.