Quantum mechanical modeling of nano magnetism : new tools based on density-functional-theory with case applications to solids, surfaces, wires, and molecules