added json writing ability to lib, having figured out how I want to do reading though