Setting bash best-practice flags

-e:          exit on error
-u:          breaks on accessing undefined variables
-x:          echo on (shows full run of script)
-o pipefail: sets failures under pipes to fail script