Clean up Gemfile.

* Use the Heroku mirror to reduce load on the rubygems.org API
* Drop the rails dependency
* Specify proper gem releases rather than pointing to git repos

cc: @shajith @vcekov