Refactor slightly to make it more testable/reusable
Got it basically working in bash and zsh.  Noticed that if the target ends with a dot, no completions are generated.
Combined the bash/zsh scripts into one script that can be sourced by both.  Added --completion_file to dynamically indicate the location of the file to source.  Getting close on #7