Improve config class to reuse existing classes and improve API

For holding values it is better to use Struct that gives required
flexibility. Also have smaller and cleaner API.