Fixed many linter errors in gui/app.js

gui/app.js had already some jslint settings in it, but it contained very many errors. This fixes most errors, but there are still some, but the remaining errors are more difficult to fix.

Rewrote the user preferred language selector to be more "angular-like".