Refactor ConfigFactory and optimize VBucket memory heap size.

This changeset refactors the ConfigFactory but not changing how it
works internally. In addition, VBucket objects are moved from int
to short and only allocate as much memory as needed.

Change-Id: Ifa8d2eff9a9cd7fe44fabb83ce8ec4ab1192f32b
Reviewed-on: http://review.couchbase.org/29850
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>