More aggressive installer database connection

Cleaned up code. Database connection for installer now attempts to
reconnect if the connection has been lost mid-way through an install.
Now error messages display cleanly underneath the item that failed.