Separate out some command implementations as internal API.

This will be used by deft-test and other commands.
Move instance next to definition.
Start fleshing out deft test.
Note about completing from registries.
Don't improperly warn when no registries entry.