Removed id and rev from export_database view.
Added documentation and some refactoring.