implement --config-write argument

closes #4