[v6r12] Optimize Request prior to insertion

the optimize method merges together consecutive operations that share the type, arguments, sourceSE, targetSE and Catalog. This is mainly to avoid having N ReplicateAndRegister operations with 1 file, while they could be done in parallel. 

The optimization is done in the service prior to insertion in the DB.
Only the new requests are optimized, not those already in the DB.

CAUTION: while I am fairly confident about the optimization code, it will have to be carefully tested in case I omitted potential side effects