api.commands: sort commands when tabbing in the console, fixes #171