test: support mix of JS and shell based tests
test: replace onto tests with shell script

Shell script performs same basic tests, updated to account for --onto
being a modifier for --commit.
test: sls-sample-app loopback-example-app rename

Update refrence to match upstream example app's name change.
Use git detection to inform defaults

Test for git using `git rev-parse --git-dir`, which serves double duty
by also giving us the path to the .git directory.

If working on a git repo, default is equivalent to:
   sl-build --install --commit --onto deploy

If not working on a git repo, default is equivalent to:
   sl-build --install --bundle --pack

SLN-1177 #refs
Ensure create --onto branch if it doesn't exist

SLN-1177 #refs
git: Override GIT_INDEX_FILE for all git commands

This allows for better isolation between the developer's work and the
preparation of a deployment branch.
Make --onto a modifier for --commit

The --onto option overrides the default 'deploy' destination branch.
Internally, "onto" is renamed to "syncBranch", which better matches the
new behaviour.
Only merge HEAD into deploy if necessary

If the destination branch is already up to date, there is no need to
sync the branch. This is the case when the branch is newly created or
when there have been no new commits since the previous merge.

`git merge-base` is silently used behind the scenes. If it fails it
is the same as no common merge history found, which will trigger a
merge which will either succeed, or fail with a reasonable error
message.
Don't commit build results if unchanged

If the result of building is the same as the destination branch's
current content, don't bother adding an empty commit.
Refactor common git ref lookup into utility
test: ensure build can be run on HEAD