Changes requested in pull request discussion.

* Ruby extension hardcoded in test.
* restore endpoint now has its own handler.
* Just one SQL query to user_exercises and submissions.
* Functionality in controller actions again.
* Assignments format without redundant data.