Reversed commit list into chronological order before
converting to JSON. Added comments, rearranged code.