JS string.makeTitle function