First-principles investigation of LaMg2Ni and its hydrides