Changes to fully support bx.

The main difference with bx is generalizations to support bash-completion. This also includes other fixes.