Better graph model and added unittests for datastore.