Use join() instead of replace()

Change-Id: I64bf5d4153c9ca645d455e266df339b30b6ed1d2
Reviewed-on: http://review.couchbase.org/23872
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>