Added PartitionManager

* Added dependency to protobuf and thrift
* Added masterd sub-directory
* Added protobuf for storing the partition map in leveldb
* Added tests for PartitionManager.


PartitionManager now sync the in-ram partition mapping with leveldb, so despite of disk failure, at least it always has a consistent data on disk to survive a power failure.