Revert "Remove StoreFactory and related logic"

Breaks the Lua tests...

This reverts commit 934445af6d53819c82aad8c7726082574a554b6d.

Change-Id: I18407658dfda77348d5bf1427756c4354c7195d5
Merge "Revert "Remove StoreFactory and related logic""