cleaned up index.js, now properly writes out the favorites and applications to the page