Local structure and dynamics of hemeproteins by X-ray absorption near edge structure spectroscopy