implement local worker manager

Change-Id: I325dadc558b779e3e2c4901a9feacad1334e2c09
Reviewed-on: http://review.couchbase.org/37691
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>