Refactor Replicator to use KeyValueStore

Change-Id: I7dafe280d50fdf499fe176a8704e575333a139ae
Reviewed-on: http://naan.mimuw.edu.pl:8001/76
Tested-by: Nebulostore Nebulostore <nebulostore@gmail.com>
Reviewed-by: Szymon Matejczyk <smatejczyk@gmail.com>