QueryException improvements

QueryException expects the previous exception to be a PDOException - if it's not, the exception itself causes a fatal error because `$previous->errorInfo` is not defined. By adding an if check to the QueryException's constructor it should work with normal Exceptions as well. Alternatively, if a connection statement being ran causes an exception that's not a PDOException it could just be passed on through the app - i.e. only catch PDOExceptions, not all exceptions.

Common causes that would be helped by this would be if you have incorrect statement bindings - for example, trying to pass a multidimensional array as query bindings. However, in this case, formatMessage will fail becase str_replace_array won't accept multidimensional arrays either, but at least the exception will have a decent stack trace. Replacing multidimensional arrays with the word 'Array' could be a possible fix for this when debugging - thoughts?