Sort projects alphabetically by name within each section

This addresses part of #45 by sorting projects alphabetically by name.

I've also moved the couple helpers that were defined into a separate file under `lib`.