Functional configuration refactoring. Fixes #5

Inspired by @davecheney post: http://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
Merge pull request #7 from xarg/master

Functional configuration refactoring. Fixes #5