A unified model to refine nanocrystalline, layered and faulted material structure and microstructure from powder diffraction data