Updated command construction to be compatible with console

Related with https://github.com/symfony/symfony/issues/11794 and #252

Instead of removing the command, this has been refactored to work with the FrameworkBundle.