The database credentials are trimmed of spaces.

Commented some functions.
Added a new function that serves to trip spaces and EOL characters.
Changed some errors to be more descriptive.