Added optimizing and repairing tables back in to database module