First-principles study of the properties of Li, Al and Cd doped Mg alloys