Localization

@shaun-edwards 
Can you review what I've done so far? (I hope this is what you meant by making another branch and doing a pull request...) Thanks.
These catches encapsulate too much code...handling them would require knowledge about the order of shutdown.  My advice is to make the try block smaller (i.e. on catch per try).  I would also handle exceptions locally so that the rest of the shutdown process can occur.  Most notably, the connection should ALWAYS be disconnected when this function completes.