Use the new opm material module

With this, we get rid of quite a bit of duplicate code, but to make this work, Roland has to fix up the build system a bit to make it play nicely with modules that don't require libraries.