Structural electronic and vibrational properties of endohedral and hetero doped fullerenes and carbon nanotubes