Updated database files

Updated database files (queries, JSON encoding, etc...) to work with
updated database.