Fix model syntax errors. Add to gemfile.
Fix conflicts.
Add methods to the messages controller, untested.