Update for Ruby 2.0/Rails 4.0 compatibility

Fixed a variety of syntax issues. Updated NET:HTTP methods with proper calling signature. Cleaned up some formatting.