Refactor build and increment version scripts