Add replace_space function

  Added tests, added test file, fixed replace_space

Change-Id: Ic795c876105fe8a1a980f83a0c07a5ba2011fff5