Major rewrite.

- got rid of unecessary metaprogramming
- seperated definition of config from source of config
- make it easy to add different sources