remote-1032789: Fix JSHint warning.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remote-1032789: 2 tidy-up fixes

api.js: separate getItemType from addItem so we can use it in removeItem
and make it be more robust about 'command' as a default.
cli.js: use console.error rather than console.log for errors

Signed-off-by: Joe Walker <jwalker@mozilla.com>