Refactored command parenting logic

Now 100% less stupid.
Moved the parenting into CanaryCommand to avoid all those crazy-ass for
loop constructions all over the place.
Also shortened the code a bit. Makes for a far more readable
command manager.