Increase circular buffer size, add command-line option for mmap mode and fix state transitioning