Comments & SQL disconnect

Added comments to the main class
Now closes the MySQL database connection when the shutdown() method is
called.