Added logging and shell recognition

Added script logging, so that a log is kept of scripts that are run.

Added shell recognition, so the location of the shell is discovered.

Removed 'here document' and changed to simple echo of BB_FILE to improve broad compatibility.