custom page and post permalinks

Pages and posts now have functional custom permalinks. Permalinks with
posts are always under /year/month/day/permalink whereas pages are just
/permalink.