Fix errors on apps page

Make sure that loading the favorites JS code doesn't break other pages
that are not the files index page.
Populate favorites list (WIP)