Adapted data.php to new SQLite3/daemon setup
Tweaked SQLite3 transition in data.php