Cartridge Bash SDK cleanups

Use locals whenever possible. Remove undesirable/unused functions.