Replace RefCounter with std::shared_ptr if possible

This patch replaces ```RefCounter``` capability with ```std::shared_ptr<T>``` if c++11 features are available, and also supports rvalue reference to make full use of ```std::shared_ptr<T>```.
I think it's safer to use the standard library rather than making a sort of smart pointers ourselves.

It has passed all the tests with GCC 4.7.2 with ```-std=c++11``` option.