detailed javascript utility for reformatting a person's name