Some bug fixes. Added json file open/save.