added method foreach to mr_ic_t and refactored mr_ic_hash