Fixed mysqli error handeling
Added search/replace and writing database dump to disk before importing. Updated the way variables were being set, reduce some conditional statements.
Small wording change