Refactor into a main() function

Add a main() function.  Also only process one project's changes at a
time to help reduce how much has to be held in memory at once.

Change-Id: I6c59474da3e72e6cf21366f259173630a9a22863