EZP-21118: Implemented CORS support for the REST API

Uses NelmioCorsBundle.
Fix EZP-22101: Tweaked DefaultRouter param loading

The configResolver was used too early in a condition,
and was instanciating the legacy DB too early.