Upgrade Rails from 3.2.17 to 4.0.4

- Updates rails to 4 and upgrades gems to latest versions.
- Adds binstubs for rails and rake
- Removes vendor/plugins.
- Updates installation changes from Rails 3.x to 4.x according to
http://railsdiff.org/diff/v3.2.17/v4.0.4/