Add interactive mode and other improvements.