Add misc:comm and rewrite a couple functions.
Add misc:comm and rewrite a couple functions.

Change-Id: I6584c52b9282838376f40bf1c3347c95ab2643af
Reviewed-on: http://review.membase.org/5315
Reviewed-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>
Tested-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>

membase/ns_server,nimishzynga/ns_server,nimishzynga/ns_server,pavel-blagodov/ns_server,membase/ns_server,ceejatec/ns_server,t3rm1n4l/ns_server,nimishzynga/ns_server,mschoch/ns_server,membase/ns_server,nimishzynga/ns_server,membase/ns_server,daverigby/ns_server,mschoch/ns_server,t3rm1n4l/ns_server,ceejatec/ns_server,pavel-blagodov/ns_server,nimishzynga/ns_server,ceejatec/ns_server,nimishzynga/ns_server,mschoch/ns_server,ceejatec/ns_server,t3rm1n4l/ns_server,vzasade/ns_server,ceejatec/ns_server,daverigby/ns_server,vzasade/ns_server,membase/ns_server,daverigby/ns_server,pavel-blagodov/ns_server,daverigby/ns_server,vzasade/ns_server,t3rm1n4l/ns_server,t3rm1n4l/ns_server,membase/ns_server,mschoch/ns_server,pavel-blagodov/ns_server,daverigby/ns_server,vzasade/ns_server,ceejatec/ns_server,mschoch/ns_server,mschoch/ns_server