generic supervisor implementation

Change-Id: I42f326fc8c17b77b724fc4e498c49ea5589ef8c2
Reviewed-on: http://review.couchbase.org/43373
Reviewed-by: Xiaomei Zhang <xiaomeizhangatwork@gmail.com>
Tested-by: Xiaomei Zhang <xiaomeizhangatwork@gmail.com>