PTFM-12607 Improving bash helper variables

Summary:
1. Refactoring of code, so as to acheive sharing, between local and remote execution.
2. Adding several bash variables available to the application: filenames, prefixes, and paths.

Test Plan: additional app for testing.

Reviewers: klai

Differential Revision: https://phabricator.dnanexus.com/D88
Merge branch 'PTFM-12607-bash-helper-variables' of github.com:dnanexus/dx-toolkit into PTFM-12607-bash-helper-variables