Source Code refactoring

Summary: Identified common functionalities in a couple of methods and created merged wrappers

Test Plan: N/A

Reviewers: yhchiang

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D30159
Fixed LINT issues
Merge branch '3.9.fb' of https://github.com/krishnanm86/rocksdb into 3.9.fb