Switch to use PostgreSQL database

Also use UUID as the primary key of records. But the primary key for user
is still Integer right now.
Test production mode
Fix figures API and change upload_experiment tool