Abstract out the identifier quote style to remove hardcoded MySQL
backticks, also move out FROM_UNIXTIME. Also fixes method declarations
and some variable issues in the database abstractions which leads me to
believe that not all of the database classes actually work. Some minor
refactorings, but at large leaves things be. Inconsistent line endings
and having a mix of spaces and tabs in some places makes the diff a
little less clean than one would wish.

NOTE: The identifier quoting is slavishly done to everywhere to not
change the original code logic, though quoting should be cosmetic for
all but the "server name" field (which really should be renamed while
we're at it).