Add option to not rebuild commits that already have a status

Replace the BUILD_ALL_COMMITS setting with a BUILD_COMMITS setting that
can be one of 'ALL', 'LAST', or 'NEW' that build all commits, only the
last commit, or only commits without a status.

This setting defaults to 'NEW'.

This breaks backwards compatibility.

BUILD_ALL_COMMITS = True   <==>  BUILD_COMMITS = 'ALL'
BUILD_ALL_COMMITS = False  <==>  BUILD_COMMITS = 'LAST'