Add/improve support for logging SQL queries

Prior this this commit, our support for logging raw SQL statements
was not well-defined (and perhaps not working).  This commit
introduces and documents two settings that you can include in
your database.ini file to control logging of SQL.

* Setting 'log-statements' to true (which is now the default) means
  that all SQL statements will be logged at DEBUG.  Because we
  leverage log4j's dynamic logging properties, this means that you
  can change the log4j.properties on a running service and set the
  log level to DEBUG if you wish to start logging queries without
  restarting the service.

* 'log-slow-queries' defines the maximum number of seconds that
  a query can execute before it is considered "slow".  "slow" queries
  are logged at the WARN log level.

This commit also introduces a new "internal" namespace for our jdbc
functions... this is intended to provide a distinction between
functions that are pseudo-public and functions that are pseudo-private
and should only be used internally.
(#15696) Add setting for restricting number of results for a resource
query

This commit introduces a setting called 'resource-query-limit',
which will cause resource queries to fail if they would return
more results than the specified value.

It also adds some utility functions to the jdbc namespace to
allow this sort of 'limit' behavior to be used elsewhere if
we decide to do so.
Move http-related utility functions into their own namespace

Conflicts:

	src/com/puppetlabs/puppetdb/http/command.clj
(#15696) Changed HTTP response status code for resource-query-limit

Prior to this commit we were returning 400 as the http response code
for resources queries that would exceed the limit.  This commit
changes the behavior to return a 500, since the problem is not
really anything to do with the format of the actual http request.
(#15696) Add new setting to README and config.ini template
(#15696) Cleanup preconditions, log messages, etc.
Move "com.puppetlabs.http.utils" to "com.puppetlabs.http"

Conflicts:

	src/com/puppetlabs/puppetdb/http/command.clj
Fix indentation
Include java type in logging output for SQL query params
Remove log-statements setting from docs

We were having a hard time coming up with a valid reason for why
we'd want a user to disable this setting, so, removing it from
the docs.
Fix docs for jdbc.internal
Move call to add-limit-clause closer to the actual query
Move add-limit-clause out of 'internal' namespace

Since we're calling this function from outside of the
jdbc namespace now, moving it back out of 'internal'.
Change default value of resource-query-limit to 20000
Fix default value for resource-query-limit in readme
Fix redhat 'service stop' bug

On redhat, if you ran "service puppetdb stop" when the service
wasn't running, you'd get a (harmless) error/warning message.

This commit fixes that.
Merge pull request #245 from cprice-puppet/bug/master/rhel-service-stop

Fix redhat 'service stop' bug
Fixes to address comments from @nicklewis on pull req
Get rid of asterisks in function names in jdbc.internal namespace
Create constants for http status codes, and use them.