improved datastore handling
more persistence
fixed a bunch of type errors