Using std/boost make_shared for creating shared pointers

Using make_shared for creating boost/std shared pointers will reduce the number of allocations
I also fixed boost::function nulling issue
This probably could done for c++11 with nullptr_t. But for boost it will be tricky. I can make some object, that will be converted to a correct null function pointer, but that would look bad.
The alternative is to make free function 
template<T> std::clear_function(T& x)
That will have correct implementation (see usage)