Generalised activity_exists() into db_object_exists()
Period object
Plugged a memory leak
Fixed reference to incomplete type
Added extra documentation