Changes config writting, now uses json