Split mod_mam into 2 modules (a separate for muc). Add a query support for mod_mam_muc.