Refactoring and code cleanup

The code generator generated a lot of duplicate code, I made an effort to clean some of these duplications.
Some things that have been done:
* Added an `sfDoctrineRestGeneratorActions` base class, holding common functions
* Factored `additional_params` variable to the object scope (thus initializing the array only once in each request)
* throw `sfValidatorError`s when validations fail (technically not refactoring, but the semantics of the code stay the same)