Functional configuration refactoring. Fixes #5

Inspired by @davecheney post: http://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis