Synchronise build system with OPM-Core

This is a roll-up of recent changes to the OPM build system.