Modal properties of photonic crystal cavities and applications to lasers