added datastore module for handling local datastorage.
added some basic data consistency stuff