Port some of the rspec dev scripts

Initial steps towards  #1140. Several of the [rspec/rspec-dev](https://github.com/rspec/rspec-dev) scripts were able to be copied directly. Others needed some slight tweaks.

Address missing travis retry scripts (ref rspec/rspec-dev#66 and rspec/rspec-dev#76). Getting the `travis_retry` function into the rake build process is more complicated than expected. Using rake's `sh` command with a `source` and a `travis_retry eval` CLI chain works locally, but fails on Travis CI. I quickly peeked at the internals of rake's `sh` and did not see a reason for the failures.

To get around this problem, add an actual bash script to `templates/`. On generating the example app, copy this script, update the proper paths, and make the script executable.
Seeing as the `custom_functions.sh` file is only loaded by this file, should the file be called `script/custom_build_functions.sh`?