add vacuum functionality to database class
add vacuum API to WritableCatalog
optimize catalogs before snapshotting
TEST: provoke defragmentation of catalogs
add Database::GetRowIdWasteRatio()
add COUNT(*) / MAX(rowid) metric for defrag
adapt integration test case 553
TEST: defrag triggered due to wasted row IDs
Cosmetics: naming conventions
Merge pull request #440 from reneme/feature-autocompact_catalog

Feature: Automatic Optimisation of Half-Empty Catalogs

This automatically detects if a catalog contains more than 20% (to be discussed) of free space and invokes a VACUUM to optimize it. The patch uses SQLite's PRAGMA page_count and PRAGMA freelist_count to determine how much free space is contained in an SQLite database file. This indicator has the advantage that it is transparent to the actual database scheme and more reliable than looking at the MAX(rowid) to COUNT(*) ratio in the catalog table.  Also a waste of row IDs greater than 25% (to be discussed) triggers a defragmentation.
Additionally it contains a test case that provokes the described behaviour.