Help doc for scripted UDAF and minor code cleanup