Added documentation of the db schema and functions