Added repair tool for database and also message box for importing

This will add a repair tool for database and also resolves the following issues:
* http://na-mic.org/Mantis/view.php?id=3080
* http://na-mic.org/Mantis/view.php?id=2818