register graceful_exit using @atexit.register for all scripts; add readline support for all scripts