Support multiple backends and add alloc backend

I wanted to let the user be able to hit Ctrl+C a few times but the way the code is written, it's useless. I'll remove.