Keep track of the commands found during parsing

It's currently impossible to easily know which commands were actually
found in a given command string. This adds tracking if you want to use
the Command system without #run blocks.