Added a shared pointer abstraction which enforces const accesses.

From: Jie Yu <yujie.jay@gmail.com>
Review: https://reviews.apache.org/r/14848