Feature add commands at position

It would be useful to define a position where a command is added. Usually when dynamically adding some commands a certain position is required.

This PR provides an optional before argument for `CommandCollection::addCommand` working the same way as the bofore argument of the `LegendInterface`.