Make Discourse work on Rails master (4.1)

External:
- [x] Wait for rails/rails#12979 to be fixed
- [x] Merge SamSaffron/vestal_versions#1

Discourse:
- [x] Add new section to Gemfile
- [x] Merge #1707
- [x] Merge #1708
- [x] Merge #1731
- [x] Merge #1732 
- [x] Merge #1737