Add `completion` command

The command prints a shell script that provides completion for the `beet`
command. To test it run `eval "$(beet completion)"` in your shell.

I also included some crude testing for this. The `test/test_completion.sh`
script runs tests in a shell and exit with a non-zero status code if the tests
fail. It assumes that the completion script is already loaded in the executing
shell.

As of now the completion only works for bash 4.1 and newer.
Remove unused code
Add note for shell support
Add completion support for bash 3.2

Bash 3.2 does not have associative arrays, so we hack around that by using
generic varibale names like `opts__$cmd`. We also don't support the "?" alias
anymore.
Move completion into beets.ui package and use pkg_resources
Completion for filenames with spaces
Test completion with clean bash instance
Do not evaluate in subshell
Use bash-completion package
bash-completion package can be set by environment
Add warning if completion package not found
Complete queries
Install bash-completion on travis
Print warning last
Add documentation for completion command
Add completion of plugin commands
Move completion_script into commands module
Use _package path instead of resource_string
fix #563: split prog parts before formating in item's name
remove debugging print statement inadvertently left from 6ef879f