Replace slot templates with macros.
Remove use of C++11 emplace.

Necessary for GCC 4.6 to compile it.
Fix cmake errors in Ubuntu 12.04.