Controlled synthesis of titanium nanochains using a template