Cool subtle bug

Found it when I was experimenting with compiler flags
Add proper compiler flags so we get some warnings
Start using C++11 stl features

Using std::function for callback and I'm loving it