kafka-1278; More flexible helper scripts; patched by Nathan Brown; reviewed by Jun Rao