The builder.py file is getting too long, so split out some code. Signed-off-by: Simon Glass <sjg@chromium.org>