Fix memory leak
Fix another memory leak.
Document DB functions
Remove double free
Rename db_url_exists to db_get_hash for consistency.
More cleanups