improve CompilerPass registering

Reduce the amount of boilerplate and always works when Symfony 2.3 is
used (which is the minimum version)