Rewrite slot to use std::function and std::bind. It's now more flexible.