Computational study of hydroxyapatite structures, properties and defects