fix undefined function error

also got rid of old console.log call
standardize code style
fix broken completion

commands that had completions defined with the one case shorthand and
the ALL type wildcard weren't being handled properly.