add environment variable to enable logging during tests
Merge pull request #2587 from mbroadst/add-logging-env-var

add environment variable to enable logging during tests
make abstract dialect more abstract

This fixes two problems in particular:
  - there was no existing way to access information about the model
    you were generating a limit and offset for, so the model has been
    added to the options
  - included where generation was done from raw SQL, making it impossible
    to support other dialects that don't support the same LIMIT syntax