added support for config files and more fine grained locking
example configuration file