Refactor artifacts

This extracts the script for installing artifacts to a template, extracts environment as well as validation related logic to separate classes.

Please note that these files were accidentally added/merged before but they weren't used: https://github.com/travis-ci/travis-build/tree/master/lib/travis/build/addons/artifacts This pull request now starts using them.

/cc @meatballhat