Phase diagram, structure, and magnetic properties of the Ge-Mn system: A first-principles study