fix config writer bugs

Typo in structure factory registration; use mass instead of simply
2*zNum for mass output
implement writer test for cfg structure writer