Optimized Database class.

Log only gets required if logging is enabled. Constants only get required when connecting to the Database.