Introduce concept of multiple datastores. Refactor + cleanup.