Added sending mail on error, checking if mysql is running (if using), improved 'command' command