Optionally use readline wrapper for agavi script, closes #1271