Laser Cooling of Atomic Beams of Ca and Mg and Its Application to Far Infrared Frequency Standards