Added in shutdown hooks to commit all changes to database and close the
statement and the connection upon completion. Also added a return
feature to the Details window.