Fix the build to use the shared module method

We were inconsistent with the use of module, making the mima stuff out of date for most cases.