Don't log to STDOUT on production.

- Scoped the `defined?(Rake)` and production check statements to
individual methods for easier testing and more clarity.
- Created a test with two contexts to simulate production and
non-production environments.

This closes #43.
I would prefer if this is not a separate method, I think with Sinatra you can check the environment shorter with `app.settings.production?` And then in tests you can do `app.environment = :production` (the `app` gets reset before every example).