json file saver implemented.

other changes as well.