Mechanistic intracellular and within-host models of bacterial and viral infections