More thread saniting

Added Directory::Listener.
Added ScopedUnlocker to avoid deadlocks on reentrant calls.
Changed Directory::Change to used perfect forwarding.
Changed DirectoryHandler to use enable_shared_from_this.
Changed functors to std::bind() so that shared_ptr is passed per request.