Use unordered_set and shared_ptr from Boost.

This makes compilation on OS X Mavericks possible, tr1/* is gone on
Mavericks.

Todo: some shared_ptr instances should really be replaced by scoper_ptrs.