Refactor frontpage.js and format feed directive