DRY-up compeltion into 3rd-party module & ensure it works as expected

Fix CLI tab completion - move completion.sh etc into 3rd-party library, fix up tab completion so it's working again.