Speedup garbage collection

Add indexes to tables
Rewrite GC code with some python magick
Vacuum only changed tables