Compile dialect modules to dynamic modules

Previously, dialect modules had to be compiled manually with the
--dynamic-module flag before use. Now, they will automatically be
compiled in the right way when required, like other modules are.
Compile nested dialects automatically as well

The previous commit built dynamic modules for first-level dialects, but
not dialects used by the first-level dialect. Build them as well.