update to work with the Sensio/GeneratorBundle 2.2

Update and refactor according to the changes in the Sensio/GeneratorBundle 2.2 version

Needs a thorough test first.