How long did it take for madaris to spread to smaller cities and towns?