Updating the db schema to include created_at and updated_at timestamps.

Also doing some cleanup of sql statements.