Fix sqlite store and store tests, move many tests, delete old code