Merged database changes into zoph.sql script

Adding a database table to store configuration
Removing a field from preferences table for a removed preference
Removing the rating field from the photos table
Adding a view on the photos and rating table to get the average rating
Adding an index on the rating table