Use thread local variables when it may be changed from parent thread
Merge pull request #38 from ToQoz/use_thread_local_variables

Use thread local variables when it may be changed from parent thread
Per request from @stevecorona on issue #37, INTERVAL is configurable.
Cut v0.1.0
added some environment variables