Determine buildNum automatically

For #70.