Rather than upsert module store, explicitly remove old value and then add new one

Replacing the content of the module store might fail if the new contents would
exceed the browser's localStorage size limit. To avoid clogging the browser
with stale data, always remove the old value before attempting to set the new
one.

Change-Id: I91d01d845a1a633414b94cc02e142a9956955c9d
Merge "Rather than upsert module store, explicitly remove old value and then add new one"