NGI_pipeline working version

It is still under testing but it should be pretty stable: @mario please review it carefully
Hey that is a good idea! I think this was my code actually. I'll change it. Tack Guillem!