Structure and Ferromagnetism of Thin Magnetic Layers