Merge pull request #1 from evendis/master

incorporates @h2h fixes with test coverage and more sane config options