Electronic, Optical and Magnetic Properties of Self-assembled Quantum Dots Containing Magnetic Ions