simplify build configuration logic using 'argparse'
Previously we manually scanned through the command line for the '--configfile' argument, handling edge cases etc. Now we leverage the 'argparse' module from the stdlib to do the same job in fewer lines.