Hamilton man, 27, refused bail after harassing ex-partner