Structural properties of thin layered materials from X-ray standing wave enhanced elastic and inelastic scattering