Updated config writer

Config writer now supports profiles and pool specific values. In
addition, the config writer now makes use of the jansson library to
create proper json objects and save them to the config file. This is
much better than trying to write our own json code.