[bldr-build] Adds new helper function & default phase implementations.
[bldr-build] Adds new helper function & default phase implementations.

This change introduces several new public-facing helper functions:

* `download_file()`
* `verify_file()`
* `unpack_file()`

This allows a Plan author to use these functions to download, verify, or
unpack additional archives and artifacts. The default phase behavior use
these new functions under the covers and ensures there is one code path
to perfom the above mentioned tasks.

Additionally a new compositional style is unlocked with the creation of
a "default" implementation for each phase function. The first class
phase functions can then be overridden by Plan authors (as before), but
now they can invoke the original implementation before **adding** more
behavior. The following new public-facing helper functions have been
added:

* `do_default_begin()`
* `do_default_download()`
* `do_default_verify()`
* `do_default_clean()`
* `do_default_unpack()`
* `do_default_prepare()`
* `do_default_build()`
* `do_default_install()`
* `do_default_build_config()`
* `do_default_build_service()`
* `do_default_strip()`
* `do_default_dockerfile_inline()`
* `do_default_docker_image()`
* `do_default_end()`

For an example that ties both of these concepts together, consider a
slightly non-standard Plan that must download multiple patches to be
applied on top of a base release. Readline is such an example. Here is a
young version of part of a Readline Plan which downloads and verifies a
collection of patches in the appropriate phase callback functions. The
default behavior of downloading, verifying, and unpacking the main
source archive is preserved by augmenting the `do_download()` and
`do_verify()` callbacks.

Example:

```
 # The root URL for all official patch files
_patch_url_base=$_url_base/${pkg_name}-${_base_version}-patches/${pkg_name}${_base_version//.}

 # All official patch file URLs
_patch_files=(
  ${_patch_url_base}-001
  ${_patch_url_base}-002
  ${_patch_url_base}-003
  ${_patch_url_base}-004
  ${_patch_url_base}-005
  ${_patch_url_base}-006
  ${_patch_url_base}-007
  ${_patch_url_base}-008
)

 # All official patch file shasums
_patch_shasums=(
  1a79bbb6eaee750e0d6f7f3d059b30a45fc54e8e388a8e05e9c3ae598590146f
  39e304c7a526888f9e112e733848215736fb7b9d540729b9e31f3347b7a1e0a5
  ec41bdd8b00fd884e847708513df41d51b1243cecb680189e31b7173d01ca52f
  4547b906fb2570866c21887807de5dee19838a60a1afb66385b272155e4355cc
  877788f9228d1a9907a4bcfe3d6dd0439c08d728949458b41208d9bf9060274b
  5c237ab3c6c97c23cf52b2a118adc265b7fb411b57c93a5f7c221d50fafbe556
  4d79b5a2adec3c2e8114cbd3d63c1771f7c6cf64035368624903d257014f5bea
  3bc093cf526ceac23eb80256b0ec87fa1735540d659742107b6284d635c43787
)

do_download() {
  do_default_download

  # Download all patch files, providing the corresponding shasums so we can
  # skip re-downloading if already present and verified
  for i in $(seq 0 $((${#_patch_files[@]} - 1))); do
    p="${_patch_files[$i]}"
    download_file $p $(basename $p) ${_patch_shasums[$i]}
  done; unset i p
}

do_verify() {
  do_default_verify

  # Verify all patch files against their shasums
  for i in $(seq 0 $((${#_patch_files[@]} - 1))); do
    verify_file $(basename ${_patch_files[$i]}) ${_patch_shasums[$i]}
  done; unset i
}
```

As no external behavior changed, all previous Plans will execute as
before, but there are now options for Plan authors to (hopefully)
delete code to reduce duplication.

georgemarshall/habitat,rsertelon/habitat,rsertelon/habitat,georgemarshall/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,georgemarshall/habitat,georgemarshall/habitat,nathenharvey/habitat,georgemarshall/habitat,nathenharvey/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,nathenharvey/habitat,nathenharvey/habitat,georgemarshall/habitat,nathenharvey/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,georgemarshall/habitat,nathenharvey/habitat,habitat-sh/habitat,georgemarshall/habitat,habitat-sh/habitat