Customize build process.

Prep for rspec/rspec-dev#78:
- Move custom functions into dedicated file
- Update run_script to load custom functions