Sort all posts by date
Format dates in backend
Move pre-database filtering to controller; tidy posts.js