Measuring phase shifts and energy dissipation with amplitude modulation atomic force microscopy