Role of precursor composition in the polymorph transformations, morphology control and ferromagnetic properties of nanosized TiO$_2$