CBQE-0: added new function in xdcrnewbasetests.py and some re-factoring

Change-Id: Ifb2c891bb0b2cb9f2d2f7c180f0502f9389f2ea9
Reviewed-on: http://review.couchbase.org/44616
Reviewed-by: Sangharsh Agarwal <sangharsh.agarwal@globallogic.com>
Tested-by: Sangharsh Agarwal <sangharsh.agarwal@globallogic.com>