First-principles investigation of metal-hydride phase stability : The Ti-H system