Add optional dependency checking for enabling and disabling modules.