Use Enumerable#map instead of #each

This also introduces a slightly more concise operation than the previous
ternary used in a couple sorts.
Simplify front matter regex pattern
Use a ternary instead of if/else
Merge pull request #2 from zachallaun/master-review

A few improvements from code review