Small performance tweak for Posts ordering.

No issue.

* Move publishedAtCompare to standalone function in closure scope
  (allows better browser optimizations).
* Avoid getting the same field (published_at) more than once.