Bash launcher refactor

This is the beginnings of a refactoring for the bash launcher.  I intend to modernize it and fix the following bug.

Currently the JRUBY_OPTS and option parsing code requires options that affect some kinds of code to be earlier in the option list than other kinds.  For example:

```
JRUBY_OPTS="--profile.html --profile.out test.html --sample" bin/jruby test.rb
```
this returns: jruby: unknown option --sample

```
bin/jruby --profile.html --profile.out test.html --sample test.rb
```
as does this.

This means that some options cannot currently be specified in JRUBY_OPTS if it is at all possible that anything launched with JRUBY_OPTS set may use some other options.

This rewrite is still in progress, I'm sending the pull request in case I end up not having time to finish it.
in rare cases when `bash` is linked to `zsh` with some extra config to symulate `bash` the `$0` would be `main` instead of the script path, it might be safer to do `main "$0" "$@"` and then on the beginnning of `main()` do something like `typeset started_as="$1" ; shift` and use `$started_as` instead of `$0`