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.